package com.zhou.juc.test02_synchronized;

/**
 * @author zhouyanxiang
 * @create 2020-06-2020/6/20-9:01
 */
public class T1 implements Runnable {

    private int count = 10;

    @Override
    public synchronized void  run() {
        count--;
        System.out.println(Thread.currentThread().getName() + " count = " + count);
    }

    public static void main(String[] args) {
        T1 t1 = new T1();
        for (int i = 0; i < 100; i++) {
            new Thread(t1, " THREAD ---- " + i).start();
        }
    }

}
